#! user/bin/python
# -*- coding: utf-8 -*-

"""
Created on 2021/9/1 19:00

@File: final_start_main.py
@Author: LT
# -----------------------------------------------------------------------------------------------------
@Description: 
write here
# -----------------------------------------------------------------------------------------------------
"""
import os
import sys

# ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓加上这一句就和unittest一样可以直接运行了
sys.path.append(os.path.dirname(os.path.dirname(__file__)))		# 这是顶级包所在的目录的绝对路径
# ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑

__package__ = os.path.dirname(__file__).split("\\")[-1]

print(f"\n\n\npackage is--->{__package__}    file name in package is--->{__name__}\n\n\n")

# 在下面写出正确的相对导入语法
from .用于启动的主模块_PyMailGui import *

######################################################################################
# 作为顶层程序运行时：创建主邮件服务器列表窗口
######################################################################################
if __name__ == '__main__':
    rootwin = PyMailServerWindow()  # 打开服务器窗口
    if len(sys.argv) > 1:
        for savename in sys.argv[1:]:
            rootwin.onOpenMailFile(savename)  # 打开本地邮件保存文件窗口
        rootwin.lift()  # 在线程中加载本地保存文件
    rootwin.mainloop()
